/*
 * @Author: 颜礼田 2564217790@qq.com
 * @Date: 2024-08-26 10:41:26
 * @LastEditors: MrDotYan 2564217790@qq.com
 * @LastEditTime: 2024-09-21 13:29:37
 * @FilePath: /turo-repo-enterprise/apps/fuck-enterprise-admin/src/api/modules/menus.ts
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import http from "@/api";
import { PORT1 } from "@/api/config/servicePort";
import { MenusSchema } from "@/schema";
import { Id } from "../interface";

export function saveMenu(data: MenusSchema) {
  return http.post<MenusSchema>(`${PORT1}/menus/save`, data);
}

export function fetchMenusTree() {
  return http.get<Array<MenusSchema>>(`${PORT1}/menus/trees`);
}

export function fetchMenusInfo(params: Id) {
  return http.get<MenusSchema>(`${PORT1}/menus/info`, params);
}

export function editMenus(params: Id, data: MenusSchema) {
  return http.put<MenusSchema>(`${PORT1}/menus/edit`, data, { params });
}

export function removeMenus(params: Id) {
  return http.delete<MenusSchema>(`${PORT1}/menus/remove`, params);
}
